// compile this file when run sis-manager compile or install

# include "/home/gnu/sis/sis-src/sis.hpp"

# define SEP  " "

# define NAME "wash"

str
join (int argc, char** args);

int
main (int argc, char** args)
{
  // wifi save and on
  // system ("sis-save -f ~/.config/sis/wash/wifi.save `sis-wifi get`");
  run (SIS_DIR_BIN + "/sis-wifi get in " + SIS_DIR_CONF + "/wifi.wash.save");
  
  run (SIS_DIR_BIN "/sis-wifi on");


  // run shell command with wifi:
  int result = run (join (argc, args));


  // wifi load to prev
  // __run (SIS_DIR_BIN "/sis-wifi `cat ~/.config/sis/wash/wifi.save`");
  run (SIS_DIR_BIN "/sis-wifi set from " SIS_DIR_CONF "/wifi.wash.save`");

  return result;
}

str
join (int argc, char** args)
{
  str result;
  for (int i=1; i < argc; i++)
    result +=  __cpp_str args[i] + SEP;
  return result;
}
